package com.five.second_shop.service;

import com.five.second_shop.entity.Cart;
import com.five.second_shop.mapper.CartMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CartService {
    @Autowired
    private CartMapper cartMapper;

    /**
     * 新增购物车中
     * @param cart
     * @return
     */
    public Integer InsertNew(Cart cart){
       return cartMapper.InsertNew(cart);
    }

    /**
     * 查询购物车
     * @param cart
     * @return
     */
    public List<Cart> queryCart(Cart cart){
        return cartMapper.queryCart(cart);
    };

    /**
     * 根据cart动态选删除条件
     * @param cart
     * @return
     */
    public Integer delCart(Cart cart){
        return cartMapper.delCart(cart);
    }
}
